import Vue from "vue";
import VueRouter from "vue-router";

Vue.use(VueRouter);
//deep:页面的层级 barIndex:tabBar的下标值  showNav:是否显示Nav showBack:是否显示goback
const routes = [
  {
    path: "/",
    redirect: "/home",
  },
  {
    path: "/home",
    name: "home",
    component: () =>
      import("../views/L_home.vue"),
    meta: {
      deep: 2,
      showNav: 1,
      showLogin: 1,
    },
  },
  {
    path: "/main",
    name: "main",
    component: () =>
      import("../views/main.vue"),
    meta: {
      deep: 1,
      barIndex: 0,
      showNav: 1,
    },
  },
  {
    path: "/search",
    name: "search",
    component: () =>
      import("../views/search.vue"),
    meta: {
      deep: 1,
      barIndex: 1,
      showNav: 1,
      showBack: 1,
    },
  },
  {
    path: "/order",
    name: "order",
    component: () =>
      import("../views/order.vue"),
    meta: {
      deep: 1,
      barIndex: 1,
      showNav: 1,
      showBack: 1,
    },
  },
  {
    path: "/my",
    name: "my",
    component: () =>
      import("../views/my.vue"),
    meta: {
      deep: 1,
      barIndex: 2,
      showNav: 1,
      showBack: 1,
    },
  },
  {
    path: "/goShopping",
    name: "goShopping",
    component: () =>
      import("../views/goShopping.vue"),
    meta: {
      deep: 2,
      showNav: 0,
      showBack: 1,
    },
  },
  {
    path: '/city/:id',
    name: 'city',
    // 懒加载导入模块2
    component: () => import("../views/L_city.vue"),
    meta: {
      deep: 1,
      showNav: 1,
      showLogin: 1,
    },
  },
  {
    path: '/shopDetail',
    name: 'shopDetail',
    component: () => import("../views/shopDetail.vue"),
    meta: {
      deep: 3,
      showNav: 1,
      showLogin: 0,
      showBack: 1,
    },
  },
  {
    path: '/commitOrder',
    name: 'commitOrder',
    component: () => import("../views/commitOrder.vue"),
    meta: {
      deep: 4,
      showNav: 1,
      showLogin: 0,
      showBack: 1,
    },
  },
  {
    path: '/selectAddress',
    name: 'selectAddress',
    component: () => import("../views/selectAddress.vue"),
    meta: {
      deep: 5,
      showNav: 1,
      showLogin: 0,
      showBack: 1,
    },
  },
  {
    path: '/addAdress',
    name: 'addAdress',
    component: () => import("../views/addAdress.vue"),
    meta: {
      deep: 6,
      showNav: 1,
      showLogin: 0,
      showBack: 1,
    },
  },
  {
    path: '/login',
    name: 'login',
    // 懒加载导入模块2
    component: () => import("../views/L_login.vue"),
    meta: {
      deep: 2,
      showNav: 1,
      showLogin: 1,
      showBack: 1,
    },
  },
  {
    path: '/download',
    name: 'download',
    // 懒加载导入模块2
    component: () => import("../views/download.vue"),
    meta: {
      deep: 1,
      showNav: 1,
      showLogin: 1,
      showBack: 1,
    },
  },
  {
    path: '/service',
    name: 'service',
    // 懒加载导入模块2
    component: () => import("../views/service.vue"),
    meta: {
      deep: 2,
      showNav: 1,
      showLogin: 1,
      showBack: 1,
    },
  },
  {
    path: '/rating/:Caption',
    name: 'rating',
    // 懒加载导入模块2
    component: () => import("../components/Rating.vue"),
    meta: {
      deep: 2,
      showNav: 1,
      showLogin: 1,
      showBack: 1,
    }
  },
  {
    path: '/orderTag',
    name: 'orderTag',
    // 懒加载导入模块2
    component: () => import("../views/orderTag.vue"),
    meta: {
      deep: 5,
      showNav: 1,
      showBack: 1,
    },
  },
  {
    path: '/fapiao',
    name: 'fapiao',
    // 懒加载导入模块2
    component: () => import("../views/fapiao.vue"),
    meta: {
      deep: 5,
      showNav: 1,
      showBack: 1,
    },
  },
  {
    path: '/payMoney',
    name: 'payMoney',
    // 懒加载导入模块2
    component: () => import("../views/payMoney.vue"),
    meta: {
      deep: 6,
      showNav: 1,
      showBack: 1,
  }},
  {
    path: '/info',
    name: 'info',
    // 懒加载导入模块2
    component: () => import("../views/info.vue"),
    meta: {
      deep: 2,
      showNav: 1,
      showLogin: 1,
      showBack: 1,
    },
  },
  {
    path: '/vipcard',
    name: 'vipcard',
    // 懒加载导入模块2
    component: () => import("../views/vipcard.vue"),
    meta: {
      deep: 2,
      showNav: 1,
      showLogin: 1,
      showBack: 1,
    },
  },
  {
    path: '/integral',
    name: 'integral',
    // 懒加载导入模块2
    component: () => import("../views/integral.vue"),
    meta: {
      deep: 2,
    },
  },
];

const router = new VueRouter({
  mode: "history",
  base: process.env.BASE_URL,
  routes
});


export default router;
